#include"processBar.h"
#include<string.h>
#include<unistd.h>


const char *lable="|/-\\";
    char bar[NUM];
void processbar(int rate){
    int len=strlen(lable);
    printf("[%-100s][%d%%][%c]\r",bar,rate,lable[rate%len]);
    fflush(stdout);
    bar[rate++]=STYLE;
    if(rate<TOP)bar[rate]=RIGHT;

}
void initbar(){
    memset(bar,'\0',sizeof(bar));
}
